import {createBrowserRouter} from "react-router-dom";
import App from "../App.jsx";

export default createBrowserRouter([
    {
        path: "/",
        element: <App/>,
        children:[
            {
                path: "goods",
                async lazy(){
                    const Page = await import("../page/goods.jsx")
                    return {
                        element: <Page.default/>
                    }
                }
            },
            {
                path: "shoppingCart",
                async lazy(){
                    const Page = await import("../page/shoppingCart.jsx")
                    return {
                        element: <Page.default/>
                    }
                }
            },
            {
                path: "", //默认导航
                element:<div>请点击导航</div>
            }
        ]
    },

])